package com.cloud.aiservice.controller;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cloud.log.api.dubbo.LogCenterService;
import com.cloud.log.api.entity.SysLog;

@RequestMapping("/api/dubbo")
@RestController
public class DubboController {
	@Reference(version = "1.0.0")
	private LogCenterService logCenterService;
	
	@RequestMapping("/")
	public String index() {
		return "Here is AI Service dubbo api!";
	}
	
	@RequestMapping("/log")
	public String demoLog() {
		SysLog sysLog=new SysLog();
		sysLog.setEventText("來自AI 伺服器的問候！");
		logCenterService.saveDemoLog(sysLog);
		return "Here is AI Service! \"來自AI 伺服器的問候！\"";
	}
}
